 <?php
            $sqlconnect=mysql_connect('localhost', 'root', 'kissakala');
            $dbselect=mysql_select_db('theshop', $sqlconnect);
            $sqlquery="SELECT * FROM products WHERE prodName LIKE '%$_POST[search]%' OR prodNo LIKE '%$_POST[search]%' OR prodDesc LIKE '%$_POST[search]%' OR prodShortDesc LIKE '%$_POST[search]%'";
            echo $sqlquery;
            $sqlresult=mysql_query($sqlquery, $sqlconnect);
            $searchArray = array();
            while($sqlRow=mysql_fetch_array($sqlresult, MYSQL_ASSOC))
            {
                $id=$sqlRow['prodNo'];
                $pic=$sqlRow['prodPic'];
                $name=$sqlRow['prodName'];
                $desc=$sqlRow['prodDesc'];
                $value=$sqlRow['prodValue'];
                $amount=$sqlRow['prodAmount'];
                $ship=$sqlRow['prodShip'];
                $descshort=$sqlRow['prodShortDesc'];
                $searchArray[] =$id;
            }
            if (!$_GET["page"]) {
                $_GET["page"] = 1;
            }
//            print_r($searchArray);
//            foreach ($array1 as $value) {
//                echo $value[0];
//                if (!in_array($value[0], $searchArray)) {
//                   unset($array1[$value[0]]);
//                }
////                #echo $value[0];
////                if (!in_array($value[0]+1,$searchArray)) {
////                    echo "F ", $value[0];
////                    unset($array1[$value[0]]);
////                }
//            }

            layoutTable($array1, "img/icons/buy.PNG", "img/icons/buy_hover.PNG", "search.php", $_GET["page"]);
            mysql_c